package cn.lili.controller;


import cn.lili.listener.NoticeMessageListener;
import cn.lili.modules.message.entity.dos.Message;
import cn.lili.modules.message.entity.dto.NoticeMessageDTO;
import cn.lili.modules.sms.entity.dto.SmsReachDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 异常消息重推
 *
 * @author liushuai(liushuai711 @ gmail.com)
 * @version v4.0
 * @Description:
 * @since 2023/4/14 16:39
 */
@RestController
@RequestMapping("/consumer/message")
@Api(tags = "异常消息API")
@RequiredArgsConstructor
public class NoticeMessageRePush {


    private final NoticeMessageListener noticeMessageListener;

    @ApiOperation(value = "重新发送订单状态消息")
    @GetMapping("/notice")
    public void notice(NoticeMessageDTO noticeMessageDTO) {
        noticeMessageListener.notice(noticeMessageDTO);
    }


    @ApiOperation(value = "短信发送")
    @GetMapping("/smsReach")
    public void smsReach(SmsReachDTO smsReachDTO) {
        noticeMessageListener.smsReach(smsReachDTO);
    }


    @ApiOperation(value = "消息发送")
    @GetMapping("/message")
    public void message(Message message) {
        noticeMessageListener.message(message);
    }
}
